package com.htl.io.缓冲流;

import java.io.*;

/**
 *  字节输入缓冲流 BufferedInputStream
 */

public class BufferedInputStream__test {
    public static void main(String[] args) {
        BufferedInputStream bufferedInputStream = null;
        InputStream inputStream = null;
        try {
            inputStream = new FileInputStream("D:\\Project\\IDEA_project\\java_note\\src\\com\\htl\\io\\缓冲流\\test.txt");
            bufferedInputStream = new BufferedInputStream(inputStream);
            int temp = 0;
            while (((temp = bufferedInputStream.read()) != -1)) {
                System.out.println(temp);
            }

        } catch (FileNotFoundException e) {
            e.printStackTrace();
        } catch (IOException e) {
            e.printStackTrace();
        } finally {
            try {
                inputStream.close();
                bufferedInputStream.close();
            } catch (IOException e) {
                e.printStackTrace();
            }
        }

    }
}
